package org.rency.mq.kafka.producer.request;

/**
 * 发送消息请求
 *
 * @author: Created by user_rcy@163.com on 2016/10/11.
 * @version: V1.0.0
 * @since JDK 1.8
 */
public class MessageEvent<K, V> {

    private String topicName;

    /**
     * 消息标识
     */
    private K key;

    /**
     * 消息内容
     */
    private V content;

    /**
     * 分区数量
     */
    private int partition;

    public String getTopicName() {
        return topicName;
    }

    public void setTopicName(String topicName) {
        this.topicName = topicName;
    }

    public K getKey() {
        return key;
    }

    public void setKey(K key) {
        this.key = key;
    }

    public V getContent() {
        return content;
    }

    public void setContent(V content) {
        this.content = content;
    }

    public int getPartition() {
        return partition;
    }

    public void setPartition(int partition) {
        this.partition = partition;
    }

    public String toString(){
        StringBuilder builder = new StringBuilder();
        builder.append("MessageEvent{");
        builder.append("topicName='").append(topicName).append("'");
        builder.append(", key='").append(key).append("'");
        builder.append(", content='").append(content).append("'");
        builder.append(", partition='").append(partition).append("'");
        builder.append("}");
        return builder.toString();
    }

}
